#include <iostream>
#include <boost/asio.hpp>

int main(){
    unsigned char buff[100] = {};
    buff[0] = 0x55;
    buff[1] = 0x00;
    buff[2] = 0x02;
    buff[3] = 0x03;
    buff[4] = 0x03;
    buff[5] = 0x03;
    buff[6] = 0x03;
    buff[7] = 0x03;
    buff[8] = 0x03;
    buff[9] = 0x03;
    buff[10] = 0x03;
    buff[11] = 0x03;
    buff[12] = 0x03;
    buff[13] = 0x03;
    buff[14] = 0x03;
    buff[15] = 0x03;
    buff[16] = 0x00;
    buff[17] = 0xAA;
    boost::asio::io_service* io = new boost::asio::io_service;
    boost::asio::serial_port* port = new boost::asio::serial_port(*io, "/dev/ttyUSB0");
    port->set_option(boost::asio::serial_port::baud_rate(115200));
    port->set_option(boost::asio::serial_port::flow_control());
    port->set_option(boost::asio::serial_port::parity());
    port->set_option(boost::asio::serial_port::stop_bits());
    port->set_option(boost::asio::serial_port::character_size(8));
    while (1){
        boost::asio::write(*port, boost::asio::buffer(&buff, 18));
    }
}